import * as path from 'path';
import { runTests } from '@vscode/test-electron';

async function main() {
    try {
        // 测试插件的根路径
        const extensionDevelopmentPath = path.resolve(__dirname, '../../');

        // 测试套件的根路径
        const extensionTestsPath = path.resolve(__dirname, './suite/index');

        // 运行测试
        await runTests({ 
            extensionDevelopmentPath, 
            extensionTestsPath 
        });
    } catch (err) {
        console.error('运行测试失败:', err);
        process.exit(1);
    }
}

main();
